package com.bytedance.common.plugin.framework.compat;

import android.annotation.SuppressLint;
import android.os.Build;

import java.util.LinkedHashSet;
import java.util.Set;

import inline.ApiDemo;

public final class SupportedArchitectures {
    @SuppressLint("NewApi")
    public static Set<String> supportedAbis() {
        if (ApiDemo.hasApi(21)) {
            LinkedHashSet<String> set = new LinkedHashSet();
            for (int i = 0; i < Build.SUPPORTED_ABIS.length; ++i) {
                set.add(Build.SUPPORTED_ABIS[i]);
            }
            return set;
        } else if (ApiDemo.hasApi(8)) {
            LinkedHashSet<String> set = new LinkedHashSet();
            set.add(Build.CPU_ABI);
            set.add(Build.CPU_ABI2);
            return set;
        } else {
            LinkedHashSet<String> set = new LinkedHashSet();
            set.add(Build.CPU_ABI);
            return set;
        }
    }
}

